
Use Tunga

GO
--Insert
CREATE PROC insertRestaurant
	@[name] nvarchar(100),
	@[username] nvarchar(100),
	@[password] nvarchar(100),
	@[managername] nvarchar(100),
	@[phone] nvarchar(100),
	@[address] nvarchar(100),
	@[city] nvarchar(100),
	@[picture] nvarchar(500),
	@[descr] nvarchar(500),
	@[status] bit default(0)
AS
INSERT INTO  Restaurant([name],[username],[password],[managername],[phone],[address],[city],[picture],[descr],[status])
 VALUES(@[name],@[username],@[password],@[managername],@[phone],@[address],@[city],@[picture],@[descr],@[status])

GO
--Update
CREATE PROC updateRestaurant
	@[id] int,
	@[name] nvarchar(100),
	@[username] nvarchar(100),
	@[password] nvarchar(100),
	@[managername] nvarchar(100),
	@[phone] nvarchar(100),
	@[address] nvarchar(100),
	@[city] nvarchar(100),
	@[picture] nvarchar(500),
	@[descr] nvarchar(500),
	@[status] bit default(0)
AS
UPDATE Restaurant SET	
	[name] =@[name],
	[username] =@[username],
	[password] =@[password],
	[managername] =@[managername],
	[phone] =@[phone],
	[address] =@[address],
	[city] =@[city],
	[picture] =@[picture],
	[descr] =@[descr],
	[status] =@[status]
WHERE 	[id] =@[id]
GO
--Delete
CREATE PROC deleteRestaurant
	@[id] int
AS
	DELETE FROM Restaurant WHERE [id]=@[id]
GO
--Get All Restaurant
CREATE PROC getAllRestaurant
AS
SELECT * from Restaurant
GO
--Get Restaurant By ID
CREATE PROC getRestaurantByID
	@[id] int
AS
SELECT * from Restaurant WHERE [id]=@[id]
GO


